package com.amos.web;

import com.amos.service.AccountService;
import com.amos.service.dto.AccountDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Amos
 * @ClassName QueryController
 * @Description TODO
 * @Date 2018/12/4 21:05
 * @VERSION 1.0
 **/
@RestController
@RequestMapping("/query")
@Api("QueryController相关的api")
public class QueryController {


    @Autowired
    private AccountService accountService;

    @ApiOperation(value = "测试接口", notes = "测试接口")
    @ApiImplicitParam(name = "name", value = "名称", paramType = "query", required = true, dataType = "String")
    @GetMapping("/load/{id}")
    public AccountDTO sayHi(@PathVariable("id") String id) {
        return (AccountDTO) accountService.load(id);
    }

}
